package com.atguigu;

/**
 * @author : leimingchao
 * @date Date : 2021年07月21日 22:28
 */
public class Exercise {

    public static void main(String[] args) {
        int factor = 0;
        for (int i = 1; i <= 1000; i++) {
            for (int j = 1; j <= i / 2; j++) {
                if (i % j == 0) {
                    factor += j;
                }
            }
            if (i == factor) {
                System.out.println(i);
            }
            //将factor置为0
            factor = 0;
        }
    }
}
